home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / Thumb1.pxl < prev    next >
Text File  |  2000-12-23  |  6KB  |  192 lines

  1. Initialize:
  2.  
  3.     WinGetActive(Win$)
  4.     UseCoordinates(PIXEL)
  5.     WinLocate(Win$,100,100,570,385,Res)
  6.     Title$ = "PiXCL 4.4 Images and Rectangles"
  7.     WinTitle(Win$, Title$)
  8.     DirGet(SourceDir$)
  9.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  10.     
  11.     InfoMenu(REMOVE)
  12.     WaitInput(100)
  13.     SetMenu("&File",IGNORE,
  14.         "E&xit",Leave,
  15.         ENDPOPUP, 
  16.         "&Image Load",Image_Load,
  17.         ENDPOPUP,
  18.         "&Edge Rectangles",EdgeRect,
  19.         ENDPOPUP,
  20.         "&Help",IGNORE,
  21.         "&Concept",Concept,
  22.         "&View Source",ViewSource,
  23.         SEPARATOR,
  24.         "&About PiXCL",About_Pixcl,
  25.         ENDPOPUP)
  26.         
  27.         Btn1 = 1
  28.         Btn2 = 1
  29.  
  30. Wait_for_Input:
  31.     WaitInput()
  32.  
  33.  
  34. Leave:
  35.     End
  36.  
  37.  
  38. ViewSource:
  39.     PXL_File$ = SourceDir$ + "\thumb1.pxl"
  40.     Cmd$ = "Notepad " + PXL_File$
  41.     Run(Cmd$)
  42.     Goto Wait_for_Input
  43.  
  44. InvertRect:
  45.     InvertRectangle(10,10,200,200)
  46.     DrawStatusText(cx1,cy1,cx2,cy2,"Double Mouse pressed",NOBORDER)
  47.     Goto Wait_for_Input
  48.  
  49. Image_Load:
  50.     UseBackGround(TRANSPARENT,192,192,192)
  51.     DrawBackground
  52.     DrawEdgeRectangle(6,6,205,205,SUNKENEDGE,ADJUST,RECT)
  53.  
  54.     Image$ = SourceDir$ + "\1iddnext.bmp"
  55.     DrawSizedBitMap(10,10,200,200,Image$)
  56.     UseCaption(Title$)
  57.  
  58.     DrawEdgeRectangle(220,20,285,85,ETCHEDEDGE,ADJUST, RECT)
  59.     DrawEdgeRectangle(300,20,365,85,RAISEDEDGE,ADJUST,RECT)
  60.  
  61.     DrawText(230,90,"Button #1")
  62.     DrawText(310,90,"Button #2")
  63.  
  64.     SetRightMouse(220,20,285,85,Btn1_Up,X,Y)
  65.     SetMouse(220,20,285,85,Btn1_Down,X,Y,
  66.          300,20,365,85,Btn2,X,Y)
  67.     SetCtrlMouse(220,20,285,85,Btn1_Gray,X,Y)
  68.     SetShftRightMouse(300,20,365,85,Btn2off,X,Y)
  69.     Btn2_Flag = 0
  70.  
  71.     WinGetClientRect(Title$,cx1,cy1,cx2,cy2)
  72.     cx1 = 5  cx2 = cx2 - 2
  73.     cy1 = cy2 - 22  cy2 = cy2 - 2
  74.     DrawEdgeRectangle(cx1,cy1,cx2,cy2,SUNKENEDGE,ADJUST,RECT)
  75.  
  76.     SetDblMouse(10,10,200,200,InvertRect,X,Y)
  77.     Goto Wait_for_Input
  78.  
  79. Btn1_Up:
  80.     DrawEdgeRectangle(220,20,285,85,RAISEDEDGE,ADJUST, RECT)
  81.     DrawStatusText(cx1,cy1,cx2,cy2,"Right Mouse pressed",NOBORDER)
  82.     If Btn1 = 0 
  83.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  84.         DrawText(231,91,"Button #1")
  85.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  86.         DrawText(230,90,"Button #1")
  87.         Btn1 = 1
  88.     Endif
  89.     Goto Wait_for_Input
  90. Btn1_Down:
  91.     DrawEdgeRectangle(220,20,285,85,SUNKENEDGE,ADJUST, RECT)
  92.     DrawStatusText(cx1,cy1,cx2,cy2,"Left Mouse pressed",NOBORDER)
  93.     If Btn1 = 0 
  94.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  95.         DrawText(231,91,"Button #1")
  96.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  97.         DrawText(230,90,"Button #1")
  98.         Btn1 = 1
  99.     Endif
  100.     Goto Wait_for_Input
  101. Btn1_Gray:
  102.     DrawEdgeRectangle(220,20,285,85,ETCHEDEDGE,ADJUST, RECT)
  103.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  104.     DrawText(231,91,"Button #1")
  105.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,128,128,128)
  106.     DrawText(230,90,"Button #1")
  107.     Btn1 = 0
  108.     DrawStatusText(cx1,cy1,cx2,cy2,"Ctrl-Left Mouse pressed",NOBORDER)
  109.     Goto Wait_for_Input
  110.  
  111. Btn2:
  112.     If Btn2_Flag = 1
  113.         Btn2_Flag = 0
  114.         DrawEdgeRectangle(300,20,365,85,SUNKENEDGE,ADJUST,RECT)
  115.     Else
  116.         Btn2_Flag = 1
  117.         DrawEdgeRectangle(300,20,365,85,RAISEDEDGE,ADJUST,RECT)
  118.     Endif
  119.     If Btn2 = 0 
  120.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  121.         DrawText(311,91,"Button #2")
  122.         UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
  123.         DrawText(310,90,"Button #2")
  124.         DrawStatusText(cx1,cy1,cx2,cy2,"Left Mouse pressed",NOBORDER)
  125.         Btn2 = 1
  126.     Endif
  127.     Goto Wait_for_Input
  128.  
  129. Btn2off:
  130.     DrawEdgeRectangle(300,20,365,85,ETCHEDEDGE,ADJUST,RECT)
  131.     DrawStatusText(cx1,cy1,cx2,cy2,"Shift Right Mouse pressed",NOBORDER)
  132.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
  133.     DrawText(311,91,"Button #2")
  134.     UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,128,128,128)
  135.     DrawText(310,90,"Button #2")
  136.     Btn2 = 0
  137.     Goto Wait_for_Input
  138.  
  139.  
  140. EdgeRect:
  141.     SetRightMouse()
  142.     SetMouse()
  143.     SetCtrlMouse()
  144.     SetShftRightMouse()
  145.  
  146.     UseBackGround(TRANSPARENT,192,192,192)
  147.     DrawBackground
  148.     UseBrush(SOLID,0,192,0)
  149.     DrawEdgeRectangle(20,20,200,100,BUMPEDGE,ADJUST, RECT) 
  150.     DrawStatusText(32,32,190,90,"BUMP EDGE",NOBORDER)
  151.  
  152.     DrawEdgeRectangle(220,20,400,100,ETCHEDEDGE,ADJUST, RECT)
  153.     DrawStatusText(232,32,390,90,"ETCHED EDGE",NOBORDER)
  154.  
  155.     DrawEdgeRectangle(20,120,200,200,RAISEDEDGE,ADJUST, RECT) 
  156.     DrawStatusText(32,132,190,190,"RAISED EDGE",NOBORDER)
  157.  
  158.     DrawEdgeRectangle(220,120,400,200,SUNKENEDGE,ADJUST, RECT) 
  159.     DrawStatusText(235,122,375,140,"SUNKEN EDGE",NOBORDER)                
  160.     DrawEdgeRectangle(240,150,380,190,RAISEDEDGE,ADJUST, RECT)                 
  161.     DrawStatusText(245,155,375,185,"RAISED EDGE",NOBORDER)
  162.  
  163.  
  164.     Goto Wait_for_Input
  165.  
  166. Concept:
  167.     MessageBox(OK,1,INFORMATION,
  168. "Menu item 'image load' displays a sized bitmap image and 
  169. draws two buttons that demonstrate edge rectangles and 
  170. mouse active regions. 
  171.  
  172. Button #1 will raise or depress with left or right mouse clicks,
  173. and become embossed and flat with a control-left click.
  174.  
  175. Button #2 will alternately raise and depress with a left click,
  176. and become embossed and flat with a shift-right click. 
  177.  
  178. Double click the image and its colors will invert.
  179.  
  180.  
  181. The 'Edge Rectangles' menu item displays the set of edge
  182. rectangle styles available.",
  183.     "Using edge rectangles as buttons.", Res)
  184.     Goto Wait_for_Input
  185.  
  186. About_Pixcl:
  187.     AboutUser("PiXCL 4.4 Sample Program","Displaying images with Buttons",
  188. "This program shows the image loading and mouse 
  189. active areas. Try clicking the left, ctrl left, double 
  190. and right mouse and shift-right mouse on the buttons.")
  191.     Goto Wait_for_Input
  192.